package com.ys.utils;

import com.ys.entity.Stu;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @ClassName Main
 * @Author 1628994918qq.com
 * @Date 2023/2/8 11:01
 */
public class Main {
    public static void main(String[] args) {

        /*Calendar calendar = Calendar.getInstance();
        int nowYear = calendar.get(Calendar.YEAR);
        int lastYear = calendar.get(Calendar.YEAR)+1;
        System.out.println(Calendar.YEAR);
        System.out.println("当前年份："+nowYear);
        System.out.println("去年年份："+lastYear);*/


        /*System.out.println( DateFormatUtils.format(new Date(),"yyyy-MM-dd"));

        System.out.println("-------------------------------");
        Stu stu = new Stu();
        System.out.println(DateFormatUtils.format(stu.getBirthday(),"yyyy-MM-dd"));*/

        String s = "1";
        Map map = new HashMap();
        map.put("a","1");
        /*BigDecimal bigDecimal = (BigDecimal) map.get("a");
        System.out.println("String强转："+bigDecimal);
*/
        BigDecimal b = new BigDecimal(s);
        System.out.println("s对象转换类型："+ b);

        BigDecimal b1 = new BigDecimal((String) map.get("a"));
        System.out.println("map中的字符串对象转换类型："+ b1);


        Set set = new HashSet<>();
        Stu stu = new Stu();
        Stu stu1 = new Stu();
        stu.setStuId("www");
        stu1.setStuId("www1");
        set.add(stu);
        set.add(stu1);
        set.addAll(map.keySet());
        System.out.println("set = " + set);
    }
}
